package org.brain.tool;



import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ImageOpera {
    
    public void ImageCopy(String inFilePath,String outFilePath)
    {
    	  InputStream is = null;
          OutputStream os = null;
          try {
              System.out.println("---------Start");
              is = new FileInputStream(inFilePath);
              os = new FileOutputStream(outFilePath, false);
              int i;
              while ((i = is.read()) != -1) {
                  os.write(i);
              }
              System.out.println("---------End");
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              try {
                  is.close();
                  os.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
    }
    
    public void ImageDel(String filepath)
    {
    	File file = new File(filepath);
    	if(file.exists())
    	{
    		file.delete();
    	}
    }
    
}
